import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { DatabaseAccess } from '@/entity/DatabaseAccess';
import { Permission } from '@/entity/Permission';
import { Role } from '@/entity/Role';
import { RolePermission } from '@/entity/RolePermission';
import { TableAccess } from '@/entity/TableAccess';
import { User } from '@/entity/User';
import { UserRole } from '@/entity/UserRole';
import { PermissionController } from '@/user/permission.controller';
import { PermissionService } from '@/user/permission.service';
import { RoleController } from '@/user/role.controller';
import { RoleService } from '@/user/role.service';
import { UserController } from '@/user/user.controller';
import { UserService } from '@/user/user.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      User,
      Role,
      Permission,
      UserRole,
      RolePermission,
      TableAccess,
      DatabaseAccess,
    ]),
  ],
  controllers: [UserController, PermissionController, RoleController],
  providers: [UserService, PermissionService, RoleService],
  exports: [UserService, PermissionService, RoleService],
})
export class UserModule {}
